AstroBASIC Variables, Commands and Functions list Ver. 1.01 by Richard C. Degler - re-typed 9/9/2019 VARIABLEs are Words that can freely be Read AND Written to - In computer-ese, Bytes are 8-bits wide and can hold 0 to 255. Words are 2 consecutive Bytes long, and can have data values equivalent to decimal -32768 thru 32767 using one bit as Sign. 26 One-letter Read/Write Storage-only full-Word Variables : A [now located at %(20002) note: see '%' below] and runs in alphabetical order by 2's up through to Z [at %(20052) decimal] making %(20054) the following] : note: In Bally Basic (updated to Astro Basic), _device_ Words also control and report on the various parts of the hardware - 6 Two-letter old BallyBasic Read/Write _device_ Variables : BC [Background Color] - default 7 White FC [Foreground Color] - default 0 Black NT [Note Timer] - default 2 (was 3 in BB) CX [Cursor X position] - default -77 CY [Cursor Y position] - default 40 XY [XY position] - from last LINE command 12 new Two-letter AB _device_ Variables (except for ReMainder) : MO [frequency of Master Oscillator] - 71 TA [frequency of Tone A] - oscillator A used for Notes TB [frequency of Tone B] - osc B default 0, 255 max TC [frequency of Tone C] - osc C default 0, 255 max VR [Vibrato modulation Range] - depth 0 to 63 VF [Vibrato changes Frequency] - rate 0 to 3 VC [Volume of voice C] - default 0, 15 max NM [Noise Mode] - 2-bits Vibrato if 0, Noises 1 to 3 VA [Volume of voice A] - default 0, 15 for a Note VB [Volume of voice B] - default 0, 15 max NV [Noise Volume] - default 0, to 15 max RM [ReMainder] - from last divide (as in BB) SM [screen text Scroll Mode] - new for AB as listed ... SM=0 - Scrolls conventionally [at bottom of screen, as in BB]. SM=1 - Suppresses scrolling, cursor stays at bottom line SM=2 - Holds cursor at screen bottom, clears after each CR SM=3 - Clears the screen and resets cursor to screen top. SM=4 - AUTO-PAUSE, release by pressing any key. After release the screen will clear and printing will resume from screen top. a direct Word read / write [ =%() or %()= ] on a Byte boundary : %(+nnnnn) [from 0 to 32767 see: Memory Map for address ranges] or %(-nnnnn) [to -32768 Interlaced Data at -nnnnn times 2 AND 65535] 2 overlapping Variable Arrays following Program : @(0 to SZ/2) - AT-Array Words ascending from TXTUNF+4 *(SZ/2 to 0) - Star-Array Words descending from DFTLMT TXTUNFilled and DeFineTextLiMiT are known by their SZ difference! COMMANDs cause an effect based on their Parameters - 2 Commands to Output a single Character : TV= [TeleVision] - to Virtual Display Monitor MU= [MUsic] - Play a Note to Speaker ONLY a new Command for AB to Mute all Sounds : 'down-arrow' [entered as 'BLUE' then '3' on the keypad] a Command to Output a Byte to ... &(0 to ??)= [to any OutPort directly] 15 WORD-shifted Commands : LIST (optional Start line)(optional ,Number of lines) CLEAR [reset VDM screen] - "WHAT?" if any arguments RUN [re-initialize and go around again] - no arguments NEXT [if Var. matches FOR loop, add STEP, exit if greater] LINE X,Y,T [draw vector to new X,Y location in Type 0 to 3] IF [if Comparison (see below) is False, bail to next Line] GOTO [abandon current position and go to new Line given] GOSUB [save current position and go to new Line given] RETURN [no arguments, just goes back to latest GOSUB] BOX X,Y,W,H,T [draw a BOX from origin, +/- sizes in Type 0-3] FOR (optional STEP) [followed by TO] - mark the top of a loop INPUT (optional "String") Variable [PRINTS a ':' then inputs] PRINT (optional '#'Sizes) "Strings", Expressions, or Commas] Comparisons for IF and any other 0/1 False/True decisions : >= [is relatively Greater than or Equal] # [Left side is Not Equals Right side] > [is relatively Greater than] = [Left side is Equals Right side] <= [is relatively Less than or Equal] < [is relatively Less than] 4 Cassette TAPE Commands (all begin with a Colon) no Printer?? :PRINT (optional Start,Size in Words) saves Words + CHECKSUM Byte :INPUT (optional Starting address) loads saved Screen & Program :RUN [loads a Machine code into Screen top] then executes it :LIST [no arguments allowed, just read tape and check CheckSum] a REMark Command which goes anywhere in a Line but effectively ends it : '.' [aka 'Period' - useful for storing Bytes or half-Words from 0 to 255] and 2 spelled-out Commands : CALL machine code [preserve DE for RETurn] STOP [and return to Editor mode] FUNCTIONs assign their value to be printed OR to a variable - 18 Functions to Read Inputs : =JX(1-4) [Joystick X +/-position] - Horizontal =JY(1-4) [Joystick Y +/-position] - Vertical =TR(1-4) [TRigger status] - 0, or 1 when Pulled =KN(1-4) [KNob position] - 0 Right to 255 Left =KP [Key Press] - waits for an entry by the user =&(0 to ??) [from any InPort directly] 3 Functions to Read Other values : =PX(X,Y) [Pixel] - 0 White, 1 Black =SZ [Size] - DFTLMT minus TXTUNF pointer =ABS(+/-nnnnn) - ABSolute value of Word -32768 thru +32767 and an enter 'WORD-shift' then '6' Function : =RND(1 to +32767, or 0 un-ranged) - RaNDom number 0 to n-1 Finally, some Special keys not part of the AstroBasic language : 'Halt' (stop sign) will Break into a running Program, whilst ... 'BLUE shift' at the same time as 'WORDs shift' causes Line Trace. to Edit an existing program while Not running, enter Line, press 'Pause' [once per old character/keyword, 'Delete' or add new text] Have a Ball-y! Flash Angstrom -- __ __ \/_\/ \.. Richard Degler = fangs301@yahoo.com ::: (72 character guide) ==> = ,=